# setup the correct paths and permissions for the web2py file logger.
# we will log to /var/log/web2py/sp_web2py.log
# We will also add the web2py log to logrotate.

echo "script must be run as root"

mkdir /var/log/web2py
chown www:www /var/log/web2py
chmod 755 /var/log/web2py

cat > /etc/logrotate <<EOF
/var/log/web2py/sp_web2py.log{
 daily
 missingok
 rotate 7
 compress
 delaycompress
 create 640 www www
}
EOF

